package com.aegean.MonitorExamSYS.center.action;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.aegean.MonitorExamSYS.center.business.CenterBusiness;
import com.aegean.MonitorExamSYS.center.component.SelectExamInfo;
import com.opensymphony.xwork2.ActionSupport;

@Controller("showExamListForCenter")
@Scope("prototype")
public class showExamListForCenter extends ActionSupport {
	/**
	 * 
	 */
	private static final long serialVersionUID = -8633756473767022097L;
	@Resource
	CenterBusiness business;
	private List<SelectExamInfo> examValues;
	private int total;
	private int start;
	private int limit;
	private int small_Id;
	private int state;

	public void setExamValues(List<SelectExamInfo> examValues) {
		this.examValues = examValues;
	}

	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getStart() {
		return start;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public int getLimit() {
		return limit;
	}

	public void setLimit(int limit) {
		this.limit = limit;
	}

	public int getSmall_Id() {
		return small_Id;
	}

	public void setSmall_Id(int small_Id) {
		this.small_Id = small_Id;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}

	public List<SelectExamInfo> getExamValues() {
		return examValues;
	}

	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		try {
			examValues = business.showExanList(small_Id, state);
			if (examValues==null) {
				total = 0;
			} else {
				total = examValues.size();
			}
		} catch (Exception e) {
			// TODO: handle exception
			e.printStackTrace();
		}
		return SUCCESS;
	}

}
